package uy.com.csi.gestpro.datamodel;

import java.io.Serializable;
import java.util.List;

import javax.faces.model.ListDataModel;

import org.primefaces.model.SelectableDataModel;

import uy.com.csi.gestpro.model.proyecto.GpInfrmeDrio;

public class InformeDiarioDM extends ListDataModel<GpInfrmeDrio> implements SelectableDataModel<GpInfrmeDrio>, Serializable {
	
	private static final long serialVersionUID = 1L;
	private List<GpInfrmeDrio> idList;
	
	public InformeDiarioDM(){
	}

	public InformeDiarioDM(List<GpInfrmeDrio> idList){
		super(idList);
		this.idList = idList;
	}
	
	public GpInfrmeDrio getRowData(String rowKey) {
		Integer rk = Integer.parseInt(rowKey);
		for(GpInfrmeDrio id : idList){
			if(id.getId().compareTo(rk)==0){
				return id;
			}
		}
		return null;
	}
	
	public Object getRowKey(GpInfrmeDrio infDi){
		return infDi.getId()+"";
	}
}
